import Vue from 'vue'

const componet2 = {

  model: {

  },
  props: {

  },
  methods: {
    changeInput (event) {
      this.$emit("input", event.target.value)
    }
  },
  template: `<div><input type="text" @input="changeInput"></div>`
}

new Vue({
  components: {
    componet2
  },
  data () {
    return {
      value: ''
    }
  },
  watch: {
    value (newV, oldV) {
      console.log(newV, oldV)
    }
  },
  template: `<div><componet2 v-model="value" @changeInput="value = arguments[0]"></componet2></div>`,
  el: '#app'
})
